home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Arsenal
/
OS2 Arsenal v1.0 (Disc 1)(Arsenal Computer).ISO
/
os2_utl2
/
grep.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-01-07
|
2KB
|
44 lines
:: GREP.CMD by Carl Distefano (CIS 70154,3452) for OS/2 [11/13/93]
@echo off
goto START
This batch file implements screen-pause and output-file features for
Alexandre Polozoff's GREP utility for OS/2. Before using GREP.CMD, you
will need to configure it, as follows:
1. Copy GREP.CMD to a directory in your PATH, then open GREP.CMD with a
text editor.
2. Change "[X:\PATH\]" below to the actual drive|path of GREP.EXE.
3. Change each occurrence of "%RAMDRV%" below to the actual drive letter
for the GREP.LST output file (RAMdrive recommended).
4. Change each occurrence of "-cisx" as desired. Note, however, that
switch -c is *required* for this implementation. If you wish, you can
omit all other switches and issue them on the command-line ad lib.
Usage:
GREP [search-string] [filespec] -[switches]
Output displays one screen at a time, and is written to GREP.LST.
"Searching" status messages are filtered out. Use your favorite text
editor to browse or edit GREP.LST when the search is finished. GREP.LST is
*overwritten* with each new search.
To hear a beep upon completion, remove the colons preceding the final echo
statement. The beep is useful if you want to issue GREP as a background
command, then return immediately to other work. When the tone sounds, you
can open GREP.LST in the foreground application, e.g., your word processor.
To delete GREP.LST automatically at the end of each run (i.e., treat it as
an internal temp file), remove the colons preceding the DEL command.
Enjoy!
:START
echo Working...
echo GREP %1 %2 -cisx %3 > %RAMDRV%:\grep.lst
echo IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII >> %RAMDRV%:\grep.lst
[X:\PATH\]grep %1 %2 -cisx %3 | find /v "searching" >> %RAMDRV%:\grep.lst
::echo
type %RAMDRV%:\grep.lst | more
::del %RAMDRV%:\grep.lst